package cn.schoolwow.quickdao.test.module.business.ddl.service;

import cn.schoolwow.quickdao.test.module.business.ddl.flow.CreateTableProcessTestFlow;
import cn.schoolwow.quickdao.test.module.business.ddl.flow.QueryTableDefineFlow;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import com.alibaba.fastjson.JSONObject;

public class CreateCustomerTableTestCaseFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        {
            JSONObject updateData = new JSONObject();
            updateData.put("密码", "654321");

            flowContext.startFlow(new CreateTableProcessTestFlow())
                    .putCurrentCompositeFlowData("name", "用户表")
                    .putCurrentCompositeFlowData("updateData", updateData)
                    .execute();
        }
        {
            JSONObject updateData = new JSONObject();
            updateData.put("部门名称", "产品二部");

            flowContext.startFlow(new CreateTableProcessTestFlow())
                    .putCurrentCompositeFlowData("name", "部门表")
                    .putCurrentCompositeFlowData("updateData", updateData)
                    .execute();
        }
        flowContext.executeFlowList(new QueryTableDefineFlow());
    }

    @Override
    public String name() {
        return "创建自定义表测试用例";
    }

}
